package com.wejoy.video.middle.station.data.service.workorder;

import com.wejoy.video.middle.station.data.domain.system.SysUser;
import com.wejoy.video.middle.station.data.domain.workorder.WorkOrderInfo;

import java.util.List;

/**
 * 工单主表
 *
 * @author miracle_j
 * @date 2022年11月16日 17:28:50
 */
public interface IWorkOrderInfoService {
    /**
     * 保存或更新
     * @param req
     */
    void save(WorkOrderInfo req, String operator);

    /**
     * 插入
     *
     * @param workOrderInfo workOrderInfo
     * @return int
     */
    int insertSelective(WorkOrderInfo workOrderInfo);

    /**
     * 主键更新
     *
     * @param workOrderInfo workOrderInfo
     * @return int
     */
    int updateSelectiveById(WorkOrderInfo workOrderInfo);

    /**
     * 数量
     *
     * @param workOrderInfo workOrderInfo
     * @return int
     */
    int getCount(WorkOrderInfo workOrderInfo);

    /**
     * 数量-根据数据权限查询（自己所负责的部门）
     *
     * @param workOrderInfo workOrderInfo
     * @return int
     */
    int getDataPermissionCount(WorkOrderInfo workOrderInfo);

    /**
     * 主键查询
     *
     * @param id id
     * @return WorkOrderInfo
     */
    WorkOrderInfo getOneById(Long id);

    /**接单**/
    void acceptOrder(Long id, SysUser loginSysUser);

    /**
     * 多条
     *
     * @param workOrderInfo workOrderInfo
     * @return List<WorkOrderInfo>
     */
    List<WorkOrderInfo> getList(WorkOrderInfo workOrderInfo);

    WorkOrderInfo getOneByEventId(String eventId);

    /**
     * 分页
     *
     * @param workOrderInfo workOrderInfo
     * @return List<WorkOrderInfo>
     */
    List<WorkOrderInfo> getPageList(WorkOrderInfo workOrderInfo);

    /**
     * 分页-数据权限
     *
     * @param workOrderInfo workOrderInfo
     * @return List<WorkOrderInfo>
     */
    List<WorkOrderInfo> getDataPermissionPageList(WorkOrderInfo workOrderInfo);

    /**
     * 审核
     * @param id
     * @param operator
     */
    void audit(Long id, String operator);

    /**
     * 取消审核
     * @param id
     * @param operator
     */
    void unaudit(Long id, String operator);

    /**
     * 删除
     * @param id
     * @param operator
     */
    void delete(Long id, String operator);

    boolean canItBeUrged(Long id,Long operatorId);

    void reminders(Long id, String operator,Long operatorId);
}
